﻿@{
    ViewBag.Title = "MemberOnCreditGoods";
}

@section scripts
{   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script>       
    <script src="@Url.Content("~/Scripts/common/gridlayout.js")" type="text/javascript"></script>
}
<div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;"> 
    <table style="width:100%;">
        <tr>
            <td style="width:100%;">
                <a class="mini-button" id="refresh" iconCls="icon-search" onclick="search" plain="true">刷新</a>
                <span class="separator"></span>
                <a class="mini-button" id="close" iconCls="icon-close" onclick="CloseWindow" plain="true">关闭</a>
            </td>
        </tr>
    </table>                
</div>
<form id="form1">
    <div id = "DivHeader">
        <table style="margin-bottom:4px;">
            <tr>
                <td width ="70px" align="right">单据日期：</td>
                <td width ="310px">
                    @Html.Partial("~/Views/Modular/dxDateRange.cshtml") 
                </td>
                <td width="80px" height ="32px" align="right">选择会员：</td>
                <td width="200px" height ="32px">
                    @Html.Partial("~/Views/Modular/LookupMember.cshtml")   
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td width ="70px" align="right">门店名称：</td>
                <td width ="195px">    
                    @Html.Partial("~/Views/Modular/LookupStockInfo.cshtml")
                </td>
                <td width ="70px" align="right">商品名称：</td>
                <td width ="123px">    
                    <input name="FGoodName" class="mini-textbox" style="width:123px;"/>
                </td>
                <td width ="70px" align="right">单据编号：</td>
                <td width ="123px">
                    <input name="FBillNo" class="mini-textbox" style="width:123px;"/>
                </td>
            </tr>
        </table>
    </div>
</form>
    <div class="mini-fit" >
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" pageSize="15"
            borderStyle="border:1;" url="GetOnCreditData" showSummaryRow="true" allowCellSelect="true" allowCellEdit="true"
            showColumnsMenu="true"fitColumns="false" ondrawsummarycell="onDrawSummaryCell" sortMode="client" >
            <div property="columns">
                <div type="checkcolumn" >选行</div>
                <div type="indexcolumn" width="40" headerAlign="center" >序号</div>
                <div field="FDate" name="FDate" width="130" headeralign="center" dateFormat="yyyy-MM-dd HH:mm:ss" allowsort="true">日期</div>
                <div field="FBillNo" name="FBillNo" width="150" headeralign="center" allowsort="true">单据编号</div>
                <div field="FGoodCode" name="FGoodCode" width="100" headeralign="center" allowsort="true">商品条码</div>
                <div field="FGoodNumber" name="FGoodNumber" width="100" headeralign="center" allowsort="true">商品编码</div>
                <div field="FGoodName" name="FGoodName" width="100" headeralign="center" allowsort="true">商品名称</div>
                <div field="mFQty" name="mFQty" width="80" headeralign="center" align="right" allowsort="true" numberFormat="#,0.00">数量</div>
                <div field="mFActualPrice" name="mFActualPrice" width="80" headeralign="center" align="right" allowsort="true" numberFormat="#,0.00">单价</div>
                <div field="mFAmount" name="mFAmount" width="80" headeralign="center" align="right" allowsort="true" numberFormat="#,0.00">金额</div>
                <div field="FStockName" name="FStockName" width="100" headeralign="center" allowsort="true">门店名称</div>
                <div field="FMemberNumber" name="FMemberNumber" width="100" headeralign="center" allowsort="true">会员卡号</div>
                <div field="FMemberName" name="FMemberName" width="90" headeralign="center" allowsort="true">会员姓名</div>
                <div field="FPhone" name="FPhone" width="100" headeralign="center" allowsort="true">联系电话</div>
            </div>
        </div>
    </div>

<input type="hidden" id="type" value="@ViewBag.type" />

<script>
    var sumFields = "mFQty,mFAmount";
    mini.parse();

    //通用shown自动调用些方式
    function FormShown() {
        var toDay = new Date();
        mini.getbyName("FDate1").setValue(toDay);
        mini.getbyName("FDate2").setValue(toDay);
        LoadListData();
    }

    //加载资料列表
    function LoadListData() {
        var form = new mini.Form("#form1");
        form.validate();
        var data = form.getData(true, false);
        var formjson = mini.encode(data);
        var sSystemAppID = parent.window.getSystemAppID();
        var json = "[{";
        json = json + "'FSystemAppID':" + "'" + sSystemAppID + "',";
        json = json + "'search':'" + formjson + "','FType':'2'}]";
        var grid = mini.get("datagrid1");
        grid.load({ mydata: json });
    }

    //搜索资料列表
    function search() {
        LoadListData();
    }

</script>